import { createRouter, createWebHistory } from 'vue-router'
import layout from '@/views/layout/topNav.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: layout,
      redirect: '/sps',
      children: [
        {
          path: '/hydrology',
          component: () => import('@/views/hydrology/index.vue'),
          redirect: '/hydrology/fastManage',
          children: [
            {
              path: '/hydrology/fastManage',
              component: () => import('@/views/hydrology/fastManage.vue')
            }
          ]
        },
        {
          path: '/maintain',
          component: () => import('@/views/maintain/index.vue'),
          redirect: '/maintain/equiManage',
          children: [
            {
              path: '/maintain/equiManage',
              component: () => import('@/views/maintain/equiManage.vue')
            }
          ]
        },
        {
          path: '/monitor',
          component: () => import('@/views/monitor/index.vue'),
          redirect: '/monitor/warnManage',
          children: [
            {
              path: '/monitor/warnManage',
              component: () => import('@/views/monitor/warnManage.vue')
            }
          ]
        }, {
          path: '/polling',
          component: () => import('@/views/polling/index.vue'),
          redirect: '/polling/pollingLog',
          children: [
            {
              path: '/polling/pollingLog',
              component: () => import('@/views/polling/pollingLog.vue')
            }
          ]
        },
        {
          path: '/sps',
          component: () => import('@/views/sps/index.vue'),
          redirect: '/sps/logManage',
          children: [
            {
              path: '/sps/logManage',
              component: () => import('@/views/sps/logManage.vue')
            }, {
              path: '/sps/pump',
              component: () => import('@/views/sps/pump.vue')
            }
          ]
        }, {
          path: '/system',
          component: () => import('@/views/system/index.vue'),
          redirect: '/system/roleManage',
          children: [
            {
              path: '/system/roleManage',
              component: () => import('@/views/system/roleManage.vue')
            }
          ]
        }
      ]

    }
  ],
})

export default router
